package main

import "fmt"

// 结构体为值传递，浅拷贝
type stu struct {
	name string
	age  byte
	sli  []int
}

func main() {
	var s1 stu
	s1.name = "jack"
	s1.age = 18
	s1.sli = make([]int, 2)
	s1.sli[0] = 100
	s1.sli[1] = 200

	s2 := s1

	fmt.Println(s1, s2) // {jack 18 [100 200]} {jack 18 [100 200]}

	s2.name = "Marry"
	s2.age = 81
	s2.sli[0] = 150

	fmt.Println(s1, s2) // {jack 18 [150 200]} {Marry 81 [150 200]}

}
